Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of python setup.py extractor. #365

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

brnpl
Copy link
Contributor

@brnpl brnpl commented Dec 24, 2024

Pull request for the python setup.py extractor.

Implemented:

  • Extractor implementation;
  • Unit test implementation;
  • Integrated extractor in the main tool;


// defaultMaxFileSizeBytes is the maximum file size an extractor will unmarshal.
// If Extract gets a bigger file, it will return an error.
defaultMaxFileSizeBytes = 100 * units.MiB
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these files typically get this big - 30M should be enough

name=_pkg_name,
install_requires=[
'%s==6.5.1',
'xmlschema=={}',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean "any version"?
In that case we should store this package as version 0

'%s==6.5.1',
'xmlschema=={}',
'requests==2.25.1',
'lxml>=4.6.2',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also store versions if the comparator is >=. In that case we can store the lowest possible version, i.e. 4.6.2 in this case

'requests==2.25.1',
'lxml>=4.6.2',
'Jinja2==2.11.3;python_version<"3.6"',
# 'sslyze>=4.0.4', # todo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make sure comments are skipped, i.e. if this was # 'sslyze==4.0.4' it should not be added to the Inventory.

@@ -0,0 +1,27 @@
import re
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add 1 or 2 more sample setup.py files to the testdata to make sure we cover common cases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants